package net.siufung.boot.jwt.autoconfigure;

import lombok.AllArgsConstructor;
import net.siufung.boot.jwt.properties.JwtProperties;
import net.siufung.boot.jwt.service.IJwtService;
import net.siufung.boot.jwt.service.impl.JwtServiceImpl;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 陈建峰
 * @since 2022/2/9 11:10 下午
 */
@Configuration
@EnableConfigurationProperties({JwtProperties.class})
@AllArgsConstructor
public class JwtAutoConfig {

    private final JwtProperties jwtProperties;

    @Bean
    public IJwtService jwtService(){
        return new JwtServiceImpl(jwtProperties);
    }
}
